#ifndef REMOTE_CONTROL_H
#define REMOTE_CONTROL_H

#include <stdint-gcc.h>
#include "bsp_rc.h"
#include "usart.h"
#define SBUS_RX_BUF_NUM 18u

#define RC_FRAME_LENGTH 25u

#define UART_RX_DMA_SIZE (1024)
#define DBUS_MAX_LEN     (50)
#define DBUS_BUFLEN      (18)
#define DBUS_HUART       huart1 /* for dji remote controler reciever */

typedef struct
{
    int16_t ch[5];
    int16_t sw[2];

} sbus_rc_t;

//void sbus_to_rc(volatile const uint8_t *sbus_buf, sbus_rc_t *sbusCtrl);
//void USART1_IRQHandler(void);
//extern void remote_control_init(void);

void uart_receive_handler(UART_HandleTypeDef *huart);
void dbus_uart_init(void);
void USART_SendData(USART_TypeDef* USARTx, uint16_t Data);
void sbusPreparePacket(uint8_t *buff);
extern const sbus_rc_t *get_remote_control_point(void);

#endif